import getAxios from './axios'

export const api = getAxios({
  baseURL: import.meta.env.VITE_BASE_API,
  headers: {
    AJAX: 'true',
  },
  withCredentials: true,
})

export const apiVerify = getAxios({
  baseURL: import.meta.env.VITE_BASE_API,
  headers: {
    AJAX: 'true',
  },
  withCredentials: true,
  loading: false,
})

// 自定义error信息 有loading
export const apiCuserr = getAxios({
  baseURL: import.meta.env.VITE_BASE_API,
  headers: {
    AJAX: 'true',
  },
  withCredentials: true,
  showError: false,
})

// 自定义error信息 无loading
export const apiVerifyCuserr = getAxios({
  baseURL: import.meta.env.VITE_BASE_API,
  headers: {
    AJAX: 'true',
  },
  withCredentials: true,
  loading: false,
  showError: false,
})

export const apiVerifyArea = getAxios({
  baseURL: import.meta.env.VITE_BASE_API,
  headers: {
    AJAX: 'true',
  },
  withCredentials: true,
  loadBody: false,
})

export const nodeApi = getAxios({
  baseURL: '/node',
  headers: {
    AJAX: 'true',
  },
  withCredentials: true,
  loadBody: false,
})

// export const zhihuiApi = getAxios({
//   baseURL: '/zhihui',
//   headers: {
//     AJAX: 'true',
//   },
//   withCredentials: true,
//   loadBody: false,
// })

export const zhihuiApi = getAxios({
  baseURL: '',
  // headers: {
  //   AJAX: 'true',
  // },
  // withCredentials: true,
  // loadBody: false,
})

export const tsTransferApi = getAxios({
  responseType: 'arraybuffer',
  headers: {
    'Content-Type': 'text/plain',
  },
  loadBody: false,
})
